if (CASOn==1) then {[west,"HQ"] sideChat format ["CrossRoad to Raw Hide 1, CAS mission at %1 on the way, over.",[LaserGL] call GetRCoord];};
if (CASOn==2) then {pHarrier SideChat format ["Tango 1 to Raw Hide 1, proceeding on to %1 for CAS, target at %2m. over.",[LaserGL] call GetRCoord,(floor (LaserGL distance Harrier))]};
if (CASOn==0) then {pHarrier SideChat "Tango 1 to Raw Hide 1, no target. Pulling back to safe zone, over."};
if (CASOn==4) exitWith {[west,"HQ"] sideChat "CrossRoad to Raw Hide 1, Harrier destroyed, CAS unavailable until further notice. Good luck, over."};


if (isServer) then {

if (CASOn==1) then {
CASOn=3;PublicVariable "CASOn";
harrier=createVehicle ["av8b", getMarkerpos "cas", ["cas"], 0, "FLY"];
harrier setpos [getpos harrier select 0,getpos harrier select 1,500];
harrier setdir 90;
harrier addEventHandler ["Killed",{CASOn=4;publicVariable "CASOn";}];
harrier addEventHandler ["hit",{harrier setdamage 0;pHarrier sideChat "Tango 1 under fire, I say again, Tango 1 taking fire!"}];
publicVariable "harrier";
_grp=CreateGroup west;
pHarrier=_grp createUnit ["SoldierWPilot", [0,0,0], ["cas"], 0, "FORM"];
[pHarrier] join _grp;
pHarrier setrank "colonel";
pHarrier setskill 1;
publicVariable "pHarrier";
pHarrier moveindriver harrier;
harrier flyinheight 500;
pHarrier addEventHandler ["Killed",{CASOn=4;PublicVariable "CASOn";}];CASOn=2;PublicVariable "CASOn";};


if (CASOn==2) then {
Dostop harrier;harrier setdamage 0;
harrier flyinheight 500;
pHarrier domove position LaserGL;
CASOn=3;PublicVariable "CASOn";
};


if (CASOn==0) then {
Dostop harrier;harrier setdamage 0;harrier setfuel 1;
harrier removemagazine "300Rnd_25mm_GAU12";harrier removemagazine "6Rnd_GBU12_AV8B";
harrier addmagazine "300Rnd_25mm_GAU12";harrier addmagazine "6Rnd_GBU12_AV8B";
//harrier setpos [getMarkerpos "cas" select 0,getMarkerpos "cas" select 1,500];harrier setdir 90;
pHarrier domove getmarkerpos "cas";CASOn=3;PublicVariable "CASOn";}};
if (true) exitWith {};